package com.ggjj.filter_interceptor_controlleradvice_aop.config;

import com.ggjj.filter_interceptor_controlleradvice_aop.interceptor.InterceptorDemo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author gengjian
 * @date 2025/02/14 21:20:15
 * 将自定义拦截器加入到拦截器配置中
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Autowired
    private InterceptorDemo interceptorDemo;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceptorDemo).addPathPatterns("/**");
    }
}
